﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xunit;
using Oracle.DataAccess.Client;
using Wicresoft.UnifyShow.Business;
using Wicresoft.UnifyShow.BusinessImpl;

namespace UnifyShowTest
{
    class TestSQLTransAction
    {
        [Fact]
        public void TestTransAction()
        {
            for (int i = 1; i < 10000000; i++)
            {
                OracleDataAccess o = new OracleDataAccess();
                o.ExecuteCommand("insert into Test1 (sortnumber) values (" + i + ")");
            }
        }

        [Fact]
        public void TestTransAction1()
        {
            for (int i = 1; i < 10000000; i++)
            {
                OracleDataAccess o = new OracleDataAccess();
                o.ExecuteCommand("insert into Test1 (sortnumber) values (" + i + ")");
                o.Dispose();
            }
        }


        [Fact]
        public void Test()
        {
            Role r = new Role();
            Example e = new Example();
            r.Connection.Dispose();
            r.Connection = e.Connection;
            OracleTransaction trans = e.Connection.BeginTransaction();

            //some operation

            trans.Commit();

        }





        //var x=dr.GetSchemaTable().Rows.Count;
    }
}
